#include <iostream>
#include<set>
#include<string>
using namespace std;

int main() {
    int num;
    cin >> num;
    string str = to_string(num);
    set<char> container;
    for (int i = str.size() - 1; i >= 0; i--) {
        if (container.find(str[i]) == container.end()) {
            cout << str[i];
            container.insert(str[i]);
        }
    }
}
